package rocketman;
/*
Copyright (C) <year> <name of author>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import java.awt.Graphics2D;
import java.util.*;

public class LevelStateLevel1 implements LevelState 
{
private LinkedList<Enemy> enemies;
private LinkedList<Sprite> sprites;
private AIengine aiengine;
private int activationPixel = 0;//NOTE: doubled in class Game()
private Room room;
private LinkedList<Sprite> codecs;
private int spritecount = 3;

public void setData(LinkedList<Enemy> e, LinkedList<Sprite> s, AIengine aie, Room r, LinkedList<Sprite> c, int spritecnt)
{
	enemies = e;
	sprites = s;
	aiengine = aie;
	room = r;
	codecs = c;
	spritecount = spritecnt;
}

public void eventloop(Graphics2D g2d)
{
	activationPixel--;
      if (activationPixel == -10) {
	//test aiengine.messageEngine("123");
	room.addPart0(enemies,sprites,aiengine);
      } else if (activationPixel == -100) {
	room.addPart1(enemies,sprites,aiengine);
      } else if (activationPixel == -150) {
	room.addPart2(enemies,sprites,aiengine);
      } else if (activationPixel == -180) {
	room.addPart3(enemies,sprites,aiengine);
      } else if (activationPixel == -280) {
	room.addPart4(enemies,sprites,aiengine);
      }	else if (activationPixel == -380) {
	//room.addPart5(enemies,sprites,aiengine);//FIXME
		for (int i = 0; i < spritecount; i++) {
    			sprites.add(new SpriteScoutShip(10+i*100,400+112, "shipwhite24x24-1.png",aiengine));
		}
      }	else if (activationPixel == -500) {
	room.addPart6(enemies,sprites,aiengine);//FIXME
      } else if (activationPixel == -700) {
	//room.addPart7(enemies,sprites,aiengine);//FIXME
	for (int i = 0; i < spritecount; i++) {
    		Enemy e = new EnemyScoutShip(400+i*100,-112, "shipwhite50x50-1.png",aiengine);
    		enemies.add(e);
	}

      } else if (activationPixel == -750) {
		room.addPart8(enemies,sprites,aiengine);//FIXME
		Sprite s1 = new SpriteCodec1(0,400,"duergarcodec700x100-1.png",aiengine);
		codecs.add(s1);
      } else if (activationPixel == -850) {
		codecs.remove(0);//remove codec1
      } else if (activationPixel == -907) {
		room.addPart9(enemies,sprites,aiengine);//FIXME
      } else if (activationPixel == -927) {
    		//enemies.add(new EnemyDuergarSatteliteShip2(700,0, "shipaliengrey50x50-1.png", 4, aiengine));
    		//enemies.add(new EnemyDuergarSatteliteShip2(600,0, "shipaliengrey50x50-1.png", 4, aiengine));
      } else if (activationPixel == -947) {
		room.addPart10(enemies,sprites,aiengine);//FIXME
      } else if (activationPixel == -1030) {
		room.addPart11(enemies,sprites,aiengine);//FIXME
      }

}

public void setMapX(double mx)
{}
};




